<?php  echo $header; ?><?php  echo $column_left; ?><?php  echo $column_right; ?>
<div id="content">
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
      <h1><?php  if($nameboard == "") {echo $text_title;}else{echo $nameboard;} ?></h1>
    </div>
  </div>
  <div class="middle">
      <div class="content">
  <?php  if($webboard_guest == "1" || $register_user != null || $admin !=null) { ?>
<div style="margin-top: 12px; text-align: right;"><a onclick="location='<?php  echo 'index.php?route=webboard/new_post'; ?>'"  class="button"><span><?php  echo $text_newpost; ?></span></a></div>
   <?php  } else { ?>
<div style="margin-top: 12px; text-align: right;"><a onclick="location='<?php  echo 'index.php?route=webboard/board'; ?>'" class="button"><span><?php  echo $text_newpost_alert; ?></span></a></div>
<?php  } ?>
 <table border="0" width="100%" id="table1">
	<tr>
		<td bgcolor="#CCFFFF" align="center"><?php  echo $text_order?></td>
		<td bgcolor="#CCFFFF" align="center"><?php  echo $text_title_board?></td>
		<td bgcolor="#CCFFFF" align="center"><?php  echo $text_read?></td>
		<td bgcolor="#CCFFFF" align="center"><?php  echo $text_reply?></td>
		<td bgcolor="#CCFFFF" align="center"><?php  echo $text_author?></td>
	</tr>

<?php 
    $i=0;
   foreach ($ask as $ask_post) {
     if ($i%2==1) {$chk=' bgcolor="#CCFFCC" ';}else{$chk='';}
     if (iconv_strlen($ask_post['title'],"utf-8") > 40) {$ask=iconv_substr($ask_post['title'],0,20,"utf-8")."...";}else{$ask=$ask_post['title'];}
?>
	<tr>
		<td align="center" <?php  echo $chk?>>
		<?php  if 	($admin !=null) { ?>
		<a href="index.php?route=webboard/board&act=delete&id=<?php  echo $ask_post['ask_id'];?>&page=<?php  echo $page?>"  onClick="return Conf(this)" >
		   <img src="catalog/view/theme/default/image/b_drop.png" alt="delete"  border="0" />
		</a>
		<?php  } ?>
		<?php  echo $ask_post['ask_id'];?>
		<?php  if 	($admin !=null) { ?>
   		<a href="index.php?route=webboard/edit&id=<?php  echo $ask_post['ask_id'];?>&page=<?php  echo $page?>">
		   <img src="catalog/view/theme/default/image/b_edit.png" alt="edit"  border="0" />
		 </a>
		<?php  } ?>
		</td>
		<td <?php  echo $chk?>>
		<a href="index.php?route=webboard/read_board&id=<?php  echo $ask_post['ask_id']?>" title="<?php  echo $ask_post['title']?>"><?php  echo $ask;?></a>
		<?php  if ($ask_post['new'] <= $webboard_day) {?>
		  <img src="catalog/view/theme/default/image/new.gif" alt="new" />
		<?php  } ?>
		</td>
		<td align="right" <?php  echo $chk?>><?php  echo number_format($ask_post['counter']);?></td>
		<td align="right" <?php  echo $chk?>>
		<?php  if ($ask_post['new_reply'] <= $webboard_day) {?>
		  <img src="catalog/view/theme/default/image/new.gif" alt="new" />
		<?php  } ?>	
		<?php  echo number_format($ask_post['number_reply']);?>
		</td>
		<td align="right" <?php  echo $chk?>><?php  echo $ask_post['author'];?></td>
	</tr>
<?php   
$i++;
} 
?>

</table>
    
      
        <div class="pagination"><?php  echo $pagination; ?></div>
      
      </div>
  </div>

  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<?php  echo $footer; ?>

<script Language="Javascript">
<!--
function Conf(Object) {
	if (confirm("<?php  echo $alert?>") == true){
		return true;
	}
	    return false;
	}
//-->
</script>